package com.baturu.vin.benz.dal.dao;

import com.baturu.vin.benz.dto.BenzModelDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * BenzModelDAO
 *
 * @author majianming
 * @date 2019-04-10 20:24
 */
public interface BenzModelDAO {
    @Results({
            @Result(column = "A_BODY", property = "aBody")
    })
    @Select("select MODEL,ENGINE,MANUAL,AUTO,DIST,FRONTAX,REARAX,STEER,PLATFRM,A_BODY,CONTFLG,SALESD,TEXT,NUMRECS, seqnum, FUELCELL, HVBATTERY, EMOTOR, EXHAUSTSYS from BM_SPM_V where LANG = #{langCode} and CATNUM = #{CATNUM} and MODEL = #{model}")
    List<BenzModelDTO> queryCarModelInfo(@Param("CATNUM") String catNum, @Param("model") String model, @Param("langCode") String langCode);


    @Results({
            @Result(column = "MDLDESC", property = "modelDesc")
    })
    @Select({"select MDLDESC from DC_MODEL_DESC_V WHERE  WHC=#{whc} AND CHASSBM=#{chassbm} AND  SEQNUM=#{modelIndex}",
            "order by WHC, CHASSBM, SEQNUM limit 1"})
    String queryCarModelDesc(@Param("whc") String whc, @Param("chassbm") String chassbm, @Param("modelIndex") Integer modelIndex);
}
